package com.ruhaly.water.net;


/**
 *
 */
public class ApiManagerOld {
//    @SuppressWarnings("unused")
//    private static final String TAG = makeLogTag(ApiManagerOld.class);
//
//    private static volatile ApiManagerOld ourInstance;
//
//    private ApiServiceOld mApiServiceOld;
//    private OkHttpClient mOkHttpClient;
//    private Retrofit mRestAdapter;
//
//    public static ApiManagerOld getInstance() {
//        ApiManagerOld temp = ourInstance;
//        if (ourInstance == null) {
//            synchronized (ApiManagerOld.class) {
//                temp = ourInstance;
//
//                if (ourInstance == null) {
//                    temp = new ApiManagerOld();
//                    ourInstance = temp;
//                }
//            }
//        }
//
//        return temp;
//    }
//
//    private ApiManagerOld() {
//        initOkHttpClient();
//
//        initRetrofit();
//    }
//
//    private void initRetrofit() {
//        mRestAdapter = new Retrofit.Builder()
//                .baseUrl(ApiConstants.BASE_URL)
//                .client(mOkHttpClient)
//                .addConverterFactory(DataConvertFactoryOld.create())
//                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
//                .build();
//    }
//
//    private void initOkHttpClient() {
//        HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
//        httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
//
//
////        mOkHttpClient = new OkHttpClient.Builder()
////                .connectTimeout(20, TimeUnit.SECONDS)
////                .readTimeout(120, TimeUnit.SECONDS)
////                .addInterceptor(httpLoggingInterceptor)
////                .addInterceptor(new OkHttpInterceptor())
////                .build();
//
//        mOkHttpClient = OkHttpUtils.getInstance().getOkHttpClient();
////        OkHttpUtils.getInstance().addInterceptor(httpLoggingInterceptor);
////        OkHttpUtils.getInstance().addInterceptor(new OkHttpInterceptor());
//    }
//
//    @SuppressWarnings("unused")
//    public void clearApiService() {
//        mApiServiceOld = null;
//
//        mOkHttpClient = null;
//    }
//
//    public ApiServiceOld getApiClient() {
//        if (mApiServiceOld == null) {
//            if (mRestAdapter == null) {
//                if (mOkHttpClient == null) {
//                    initOkHttpClient();
//                }
//
//                initRetrofit();
//            }
//
//            mApiServiceOld = mRestAdapter.create(ApiServiceOld.class);
//        }
//
//        return mApiServiceOld;
//    }

}
